<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改成绩详情页面')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-score-edit" th:object="${score}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="courseId" th:field="*{courseId}" type="hidden">
            <input name="studentId" th:field="*{studentId}" type="hidden">
            <input name="semester" th:field="*{semester}" type="hidden">
            <input name="cTypeId" th:field="*{cTypeId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">成绩：</label>
                <div class="col-sm-8">
                    <input name="score"  th:field="*{score}" required class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">绩点：</label>
                <div class="col-sm-8">
                    <input name="point" th:field="*{point}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/score";
        $("#form-score-edit").validate({
            focusCleanup: true
        });

        $("#score").change(function () {
            var jd  = parseFloat(($("#score").val()-50)/10).toFixed(2);
            if (jd<=0){
                jd = 0
            }
            $("#point").val(jd);
        })



        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-score-edit').serialize());
            }
        }
    </script>
</body>
</html>
